﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Master.Master"
    Inherits="System.Web.Mvc.ViewPage<ArchiveViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <ul class="setpBySetp">
        <% 
            if (Model.Archive.NewsId != 0)
            {
        %>
        <li>
            <%= Html.ActionLink("文字信息","Edit",new { newsId = Model.Archive.NewsId })%></li>
        <li>
            <%= Html.ActionLink("图片信息", "Album", new { newsId = Model.Archive.NewsId })%></li>
        <%  
            }
            else
            {
        %>
        <li class="current">文字信息</li>
        <%
            }
        %>
    </ul>
    <div style="margin: 5px;">
        <ul class="albumListContent" id="albumListContent">
            <% 
                foreach (EAlbum item in Model.Archive.Album)
                {
            %>
            <li <%= item.IsCover?"class='cover'":"" %>>
                <img title="<%=  item.Title %>" alt="<%= item.Description %>" src="<%= Url.Action("Thumb","Home",new {w=125,h=125,s=string.Format("{0}/{1}/{2}",ViewData["ImageRoot"],Model.Archive.NewsId,item.ImageName)}) %>" />
                <div>
                    <%= Html.CheckBox("isCover", false, new { id = Guid.NewGuid() , value=item.ImageId })%></div>
                <%= Html.Hidden("ImageName", item.ImageName, new { id=Guid.NewGuid() })%>
                <%= Html.Hidden("ImageId", item.ImageId, new { id=Guid.NewGuid() })%>
                <%= Html.Hidden("Sequence" , item.Sequence , new { id=Guid.NewGuid() })%>
            </li>
            <%
                } %>
        </ul>
        <div class="overFlowHidden">
            <div class="floatLeft">
                <input type="checkbox" name="ckSelectAll" /><span class="font12 fontBold">全选/返选</span>
                <input type="button" value="设为封面" name="btnSetCover" />
                <input type="button" value="插入" name="btnInsertNew" />
                <input type="button" value="修改/描述/排序" name="btnModify" />
                <input type="button" value="删除" name="btnDelete" />
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
    <link rel="stylesheet" type="text/css" href="<%=Url.Content("~/css/Manage/ProductAlbum.css") %>" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="jsLink" runat="server">
    <script type="text/javascript" src="<%=Url.Content("~/Contents/ckfinder/ckfinder.js") %>"></script>
    <script src="<%=Url.Content("~/Scripts/Manage/Album.js") %>" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cssContent" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $(".setpBySetp li a").each(function (i, n) {
                if (n.href.toUpperCase() == document.URL.toUpperCase())
                    n.parentNode.className = "current";
            });

            Album.AppendUrl = '<%=Url.Action("Album") %>';
            Album.FkId = '<%=Model.Archive.NewsId %>';
            Album.SetCoverUrl = '<%= Url.Action("SetCover") %>';
            Album.DelUrl = '<%=Url.Action("DeleteImageItem") %>'
            Album.UpdateUrl = '<%=Url.Action("AlbumItemPost") %>';
            Album.Init();

        });
    </script>
</asp:Content>
